package com.sunfield.windpower.adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.sunfield.baseframe.base.MyRecyclerAdapter;
import com.sunfield.windpower.R;
import com.sunfield.windpower.bean.ApproveActionInfo;

import org.androidannotations.annotations.EBean;

/**
 * Created by wxl on 2017/2/8.
 */
@EBean
public class ApproveAdapter extends MyRecyclerAdapter<ApproveActionInfo, ApproveAdapter.ViewHolder> {
    public ApproveAdapter(Context context) {
        super(context);
    }

    @Override
    public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(context).inflate(R.layout.item_approve, parent, false);
        return new ViewHolder(view);
    }

    @Override
    public void onBindViewHolder(ViewHolder holder, int position) {
        holder.tv_name.setText(getItem(position).getActionName());
    }

    public class ViewHolder extends RecyclerView.ViewHolder {
        public View rootView;
        public TextView tv_name;

        public ViewHolder(View rootView) {
            super(rootView);
            this.rootView = rootView;
            this.tv_name = (TextView) rootView.findViewById(R.id.tv_name);
        }

    }
}
